<?php

namespace App\Http\Controllers\Api\v1;

use App\Http\Controllers\Controller;
use App\server\liveServer;
use Illuminate\Http\Request;
/**
 * Undocumented class
 * 直播
 * name:zf
 */
class BroadcastController extends Controller
{
    //
    public function index(){
        return view('play');
    }
    //直播
    public function broadcast(){

    }
    /**
    *
    *@param $user_ id
    *
    *@param $title
    * areturn string
    *直播
    * @yuankai
    */
    public function tlive($user_id=1, $title='性感副将，在线开播')
    {
        if(empty($user_id)) abort('10001', ' 缺少用户id');
         if(empty($title)){
            abort('10001', '缺少直播间名称');
         } //
        $Live = liveServer::getLiveStream($user_id, $num=1);
        return $Live;
    }
    /**
    *
    *@param $user_id
    *
    *@param $title
    * areturn string
    *播防
    * @yuankai
    */
    public function blive($user_id=1, $title='性感副将，在线开播')
    {
        if(empty($user_id)) abort('10001', ' 缺少用户id');
         if(empty($title)){
            abort('10001', '缺少直播间名称');
         } //
        $Live = liveServer::getLiveStream($user_id, $num=1,$type=2);
        return $Live;
    }



}
